package com.xydtech.ecard.merchant.service.impl;

import com.xydtech.common.core.text.Convert;
import com.xydtech.ecard.merchant.domain.EcardMerchantVisitInfo;
import com.xydtech.ecard.merchant.mapper.EcardMerchantVisitInfoMapper;
import com.xydtech.ecard.merchant.service.IEcardMerchantVisitInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

/**
 * 电子名片商户拜访记录Service业务层处理
 *
 * @author xydtech
 * @date 2023-08-01
 */
@Service
public class EcardMerchantVisitInfoServiceImpl implements IEcardMerchantVisitInfoService
{
    @Autowired
    private EcardMerchantVisitInfoMapper ecardMerchantVisitInfoMapper;

    /**
     * 查询电子名片商户拜访记录
     *
     * @param id 电子名片商户拜访记录主键
     * @return 电子名片商户拜访记录
     */
    @Override
    public EcardMerchantVisitInfo selectEcardMerchantVisitInfoById(Long id)
    {
        return ecardMerchantVisitInfoMapper.selectEcardMerchantVisitInfoById(id);
    }

    /**
     * 查询电子名片商户拜访记录列表
     *
     * @param ecardMerchantVisitInfo 电子名片商户拜访记录
     * @return 电子名片商户拜访记录
     */
    @Override
    public List<EcardMerchantVisitInfo> selectEcardMerchantVisitInfoList(EcardMerchantVisitInfo ecardMerchantVisitInfo)
    {
        return ecardMerchantVisitInfoMapper.selectEcardMerchantVisitInfoList(ecardMerchantVisitInfo);
    }

    /**
     * 新增电子名片商户拜访记录
     *
     * @param ecardMerchantVisitInfo 电子名片商户拜访记录
     * @return 结果
     */
    @Override
    public int insertEcardMerchantVisitInfo(EcardMerchantVisitInfo ecardMerchantVisitInfo)
    {
        return ecardMerchantVisitInfoMapper.insertEcardMerchantVisitInfo(ecardMerchantVisitInfo);
    }

    /**
     * 修改电子名片商户拜访记录
     *
     * @param ecardMerchantVisitInfo 电子名片商户拜访记录
     * @return 结果
     */
    @Override
    public int updateEcardMerchantVisitInfo(EcardMerchantVisitInfo ecardMerchantVisitInfo)
    {
        return ecardMerchantVisitInfoMapper.updateEcardMerchantVisitInfo(ecardMerchantVisitInfo);
    }

    /**
     * 批量删除电子名片商户拜访记录
     *
     * @param ids 需要删除的电子名片商户拜访记录主键
     * @return 结果
     */
    @Override
    public int deleteEcardMerchantVisitInfoByIds(String ids)
    {
        return ecardMerchantVisitInfoMapper.deleteEcardMerchantVisitInfoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除电子名片商户拜访记录信息
     *
     * @param id 电子名片商户拜访记录主键
     * @return 结果
     */
    @Override
    public int deleteEcardMerchantVisitInfoById(Long id)
    {
        return ecardMerchantVisitInfoMapper.deleteEcardMerchantVisitInfoById(id);
    }

    /**
     * 查询导出电子名片商户拜访记录列表
     * @param ecardMerchantVisitInfo
     * @return
     */
    @Override
    public List<EcardMerchantVisitInfo> selectEcardMerchantVisitInfoListByExport(EcardMerchantVisitInfo ecardMerchantVisitInfo) {
        return ecardMerchantVisitInfoMapper.selectEcardMerchantVisitInfoListByExport(ecardMerchantVisitInfo);
    }
}
